package view.plugin
{
	//充值提示
	
	import flash.display.MovieClip;
	import flash.display.SimpleButton;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	
	import flash3.framework.Singleton;
	import model.GlobalModel;
	import global.Resource;
	
	public class RechargePanel extends PanelBase
	{
		private var textField:TextField = null;
		public var btnAddMoney:SimpleButton;
		public var btnReturn:SimpleButton;
		
		public static var ADDMONEY:String = "addmoney";
		public static var EXIT:String = "exit";
		
		public function RechargePanel()
		{
			super();
			var main:MovieClip = Resource.i.getMovieClip("dlgRecharge", "DlgRecharge");
			addChild(main);
			btnAddMoney = main.btnAddMoney;
			btnReturn = main.btnReturn;
//			textField = main.text;
			btnAddMoney.addEventListener(MouseEvent.CLICK, onClickBtnAddMoney);
			btnReturn.addEventListener(MouseEvent.CLICK, onClickBtnReturn);
		}
		
		public function set text(t:String):void
		{
//			textField.text = t;
		}
		
		private function onClickBtnAddMoney(evt:MouseEvent):void
		{
			show(false);
			GlobalModel.navigateToAddMoney();
			this.dispatchEvent(new Event(ADDMONEY));
		}
		
		private function onClickBtnReturn(evt:MouseEvent):void
		{
			show(false);
			this.dispatchEvent(new Event(EXIT));
		}
		
		static public function get i():RechargePanel
		{
			return Singleton.getInstanceOrCreate(RechargePanel) as RechargePanel;
		}
	}
}